/*
 * @Author: 'zhangyu' '1838792979@qq.com'
 * @Date: 2024-06-02 17:57:47
 * @LastEditors: 'zhangyu' '1838792979@qq.com'
 * @LastEditTime: 2024-06-03 18:46:16
 * @FilePath: \node_study\express\srr.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
const express = require('express')

const app = express()

// 配置模板引擎  使用ejs来ssr渲染
app.set('views','./views')
app.set('view engine','ejs')

app.get('/login',(req,res) => {
  // 渲染模板后返回给前端
  // res.send
  res.render('login',{title:'zy'})//找views文件夹下的login.ejs
})

app.listen(3000,() => {
  console.log('3000 serve running...')
})